@import './terminal.scss';

ibz-terminal {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  --scrollbar-background-color: #ffffff7a;

  .ibz-terminal-search-bar {
    position: absolute;
    top: 12px;
    right: 20px;
    display: flex;
    align-items: center;
    padding: 8px 6px;
    z-index: 99;
    background-color: #303133;
    border-radius: 3px;
    color: #ffffff;
  }

  .ibz-terminal-search-bar--close {
    display: none;
  }

  .ibz-terminal-search-bar-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 3px 8px;
    background-color: #666666;
    border: 1px solid transparent;
    border-radius: 3px;

    &:focus-within {
      border-color: #409eff;
    }
  }

  .ibz-terminal-search-bar__input {
    flex: 0 0 auto;
    width: 150px;
    background-color: transparent;
    outline: none;
    border: none;
  }

  .ibz-terminal-search-bar__regex {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
    border: 1px solid transparent;

    &:hover {
      background-color: #46484c;
    }
  }

  .ibz-terminal-search-bar__regex--selected {
    background-color: rgba(64, 158, 255, 0.5);
    border-color: #409eff;

    &:hover {
      background-color: rgba(64, 158, 255, 0.5);
    }
  }

  .ibz-terminal-search-bar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-left: 8px;
  }

  .ibz-terminal-search-bar__button {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin-right: 4px;
    border-radius: 4px;
    cursor: pointer;

    &:last-child {
      margin-right: 0;
    }

    &:hover {
      background-color: #46484c;
    }
  }

  // 滚动条宽度
  .xterm-viewport::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background: transparent;
  }

  // 滚动槽
  .xterm-viewport::-webkit-scrollbar-track {
    border-radius: 0;
    box-shadow: none;
    border: 0;
  }

  // 滚动条滑块
  .xterm-viewport::-webkit-scrollbar-thumb {
    border-radius: 5;
    box-shadow: none;
    border: 0;
    background-color: var(--scrollbar-background-color);
  }

  .terminal.xterm {
    padding: 8px 0 0 8px;
  }
}